package com.wxh.model;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: TreeNode
 * @Description: 树节点
 * @Author wxh
 * @Date: 2020/7/16 15:40
 * @Version V1.0.0
 * @Since 1.8
 */
public class TreeNode {
    /**
     *  当前ID
     */
    protected int id;
    /**
     *  父ID
     */
    protected int parentId;
    /**
     *  当前节点的孩子节点集合
     */
    List<TreeNode> children = new ArrayList<>();

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    /**
     *  添加孩子节点
     * @param node 树节点
     */
    public void add(TreeNode node){
        children.add(node);
    }
}
